home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-01-24 | 69.8 KB | 2,561 lines |
- Newsgroups: comp.sources.misc
- organization: Eindhoven University of Technology, The Netherlands
- subject: v10i033: PC-MAIL release 2, Part01/11
- from: wswietse@lso.win.tue.nl (Wietse Venema)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 10, Issue 33
- Submitted-by: wswietse@lso.win.tue.nl (Wietse Venema)
- Archive-name: pcmail2/part01
-
- This is the second release of the pc-mail software that original-
- ly appeared in comp.sources.misc, april 1988.
-
- The pc-mail software provides a single user with facilities for
- creating, sending and receiving electronic mail messages. The
- programs were developed under UNIX but also run with MS-DOS.
- Various transport mechanisms are supported: UUCP across dial-up
- links (both GNUUCP support as well as a dedicated UUCP driver are
- provided), and PC/NFS. Porting to other OSes should be rela-
- tively easy.
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 11)."
- # Contents: FEATURES README aux aux/README aux/detab.c aux/makefile
- # daemon daemon/README daemon/dosunix.h daemon/ms_parse.h
- # daemon/mtime.h daemon/percentm.c daemon/percentm.h
- # daemon/sysexits.h daemon/syslog.h daemon/util.h main main/Beware
- # main/README main/ascf.h main/clmap.h main/comm.c main/deskutil.h
- # main/hsearch.h main/kbdinp.h main/logs.h main/mail.h
- # main/ms_parse.h main/msd_dir.h main/myalloc.c main/ndir.c
- # main/ndir.h main/screen.c main/snapshot.h main/status.h
- # main/submit.c main/sysdep.h main/textcopy.c main/work.h termcap
- # termcap/README termcap/buildall.bat termcap/makefile.msc
- # termcap/termcap.h termcap/tgetent.c termcap/tgetflag.c
- # termcap/tgetnum.c termcap/tgetstr.c termcap/tgoto.c
- # termcap/tputs.c
- # Wrapped by wswietse@tuewsa on Mon Jan 22 17:27:12 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f FEATURES -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"FEATURES\"
- else
- echo shar: Extracting \"FEATURES\" \(1075 characters\)
- sed "s/^X//" >FEATURES <<'END_OF_FEATURES'
- X@(#) FEATURES 2.1 90/01/22 13:52:19
- X
- XThe following is a summary of features available with the second
- Xpc-mail release. Features not available in the initial release
- Xare tagged with (new).
- X
- X- (new) A user tutorial.
- X
- X- Messages can be composed with any word processing package that
- Xproduces clean ASCII textfiles.
- X
- X- Alias data base to map human-readable names to ugly mail ad-
- Xdresses.
- X
- X- (new) Customized header lines and signatures.
- X
- X- (new) Selective suppression of ugly header lines.
- X
- X- (new) Subject: lines are shown in the message-selection menus.
- X
- X- (new) A reply command that extracts the sender's address from
- Xthe message being replied to. The text of the original message
- Xcan be included in the reply.
- X
- X- (new) Piping of messages through a command; this is useful for
- Xmessages that contain encoded files.
- X
- X- (new) Support for message transport through daemon processes
- Xthat run on a file server. Tested with System-V Release 2 and
- XSunOS 4.0.3
- X
- X- (new) Hooks for message transport via GNUUCP. This software has
- Xundergone little testing, though.
- X
- END_OF_FEATURES
- if test 1075 -ne `wc -c <FEATURES`; then
- echo shar: \"FEATURES\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"README\"
- else
- echo shar: Extracting \"README\" \(3918 characters\)
- sed "s/^X//" >README <<'END_OF_README'
- X@(#) README 2.1 90/01/22 13:26:22
- X
- XThis is the second release of the pc-mail software that original-
- Xly appeared in comp.sources.misc, april 1988.
- X
- XThe pc-mail software provides a single user with facilities for
- Xcreating, sending and receiving electronic mail messages. The
- Xprograms were developed under UNIX but also run with MS-DOS.
- XVarious transport mechanisms are supported: UUCP across dial-up
- Xlinks (both GNUUCP support as well as a dedicated UUCP driver are
- Xprovided), and PC/NFS. Porting to other OSes should be rela-
- Xtively easy.
- X
- XIn principle, the software can be operated in four ways, that
- Xdiffer in the location of the user's mail data base, and in the
- Xmechanism used for message transport:
- X
- X - The mail data base is local to the pc. The user does all her
- Xwork on the pc. Messages are exchanged with a UNIX host via the
- XUUCP file-transfer program provided with the pc-mail software.
- X
- X - Ditto, but GNUUCP is used for message transport and routing.
- XThe pc-mail source distribution provides programs that interface
- Xbetween pc-mail and GNUUCP.
- X
- X - The mail data base is located on a UNIX file server. The user
- Xdoes all her work on the pc. Daemon programs, running on the UNIX
- Xfile server, take care of the actual delivery of messages. The
- Xdaemon programs are part of the pc-mail source distribution and
- Xinterface with the sendmail program.
- X
- X - The mail data base is located on a UNIX host; the user does
- Xall her work on the UNIX host; daemon programs, also running on
- Xthe UNIX host, take care of the actual message delivery. Although
- Xa bit bizarre, this mode is very useful for software development.
- X
- XThe programs support the sending and receiving of electronic mail
- Xonly; no transfer of files by name and no message routing. In
- Xfact, the pc side treats each incoming data file as a mail
- Xmessage, irrespective of its actual destination. The reason for
- Xthese limitations are (besides uucp security problems) that all
- Xfiles can be sent as mail, and that a pc does not provide multi-
- Xuser support anyway.
- X
- XFor the non-technical user there is a menu-driven shell that au-
- Xtomatically invokes various utility programs, e.g. an editor of
- Xthe user's choice for editing or creating messages, a program
- Xthat logs in on a UNIX host to exchange files and so on. Any edi-
- Xtor that produces clean ASCII files can be used (wordstar files
- Xare also handled correctly). Other facilities: alias data base,
- Xbatch-mode operation, a reply command, selective suppression of
- Xmail header lines, and message templates.
- X
- XMore technically oriented users will want to avoid the interac-
- Xtive shell and use the mail data base and utility programs
- Xdirectly. The necessary information can be found in the implemen-
- Xtation documentation. In addition, almost every source file has a
- Xbuilt-in manual page. The latter can be extracted with the
- Xsrctoman.sh shell script which uses the detab.c program; both are
- Xprovided with the pc-mail source distribution.
- X
- XThe programs have been tested with various MS-DOS versions on XT
- Xand AT clones (using the MicroSoft V4.0 C compiler), with
- XMicroport System-V/AT, and with PC/NFS version 3.0. The daemon
- Xprograms were tested under Microport System-V/AT and SunOS 4.0.3.
- X
- XIn order to run the software under UNIX one needs a library with
- Xthe System-V library functions (strtok(), memcpy() et al.). The
- Xsource provides BSD-compatible libraries for directory access
- Xwithin the System-V and MS-DOS environments.
- X
- XFor the interactive shell, a tiny MS-DOS termcap library is
- Xprovided. It requires the ANSI.SYS driver or better.
- X
- XYou can do anything with the source, but not ask money for it,
- Xnor remove references to the original authors. Complaints,
- Xfeedback and suggestions are welcome. Flames to /dev/null.
- X
- X Wietse Venema domain: wswietse@lso.win.tue.nl
- X bitnet: wswietse@heitue5
- END_OF_README
- if test 3918 -ne `wc -c <README`; then
- echo shar: \"README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d aux ; then
- echo shar: Creating directory \"aux\"
- mkdir aux
- fi
- if test -f aux/README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"aux/README\"
- else
- echo shar: Extracting \"aux/README\" \(406 characters\)
- sed "s/^X//" >aux/README <<'END_OF_aux/README'
- X@(#) README 2.1 90/01/22 12:46:06
- X
- XThis directory contains utilities to extract manual pages from
- Xthe pc-mail source files.
- X
- Xsrctoman.sh A Bourne-shell script to extract documentation from source
- X files. The output is suitable for formatting with the UNIX
- X man macro library
- X
- Xdetab.c expands tabs by blanks. This program is used by the
- X srctoman.sh shell script.
- X
- Xusage:
- X
- X srctoman file | nroff -man
- END_OF_aux/README
- if test 406 -ne `wc -c <aux/README`; then
- echo shar: \"aux/README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f aux/detab.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"aux/detab.c\"
- else
- echo shar: Extracting \"aux/detab.c\" \(1170 characters\)
- sed "s/^X//" >aux/detab.c <<'END_OF_aux/detab.c'
- X/*++
- X/* NAME
- X/* detab 1
- X/* SUMMARY
- X/* expand tabs to blanks
- X/* PROJECT
- X/* sdetools
- X/* SYNOPSIS
- X/* detab
- X/* DESCRIPTION
- X/* Detab is a filter that expands tab stops in its standard input
- X/* to blanks. A tab stop distance of eight blanks is assumed.
- X/* BUGS
- X/* This program does not handle backspaces.
- X/*
- X/* Should be a standard utility, but different versions of UNIX
- X/* disagree on names or options.
- X/* AUTHOR(S)
- X/* Wietse Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sep 14 1985
- X/* LAST MODIFICATION
- X/* 10/18/89 21:52:21
- X/* VERSION/RELEASE
- X/* 1.4
- X/*--*/
- X
- X#include <stdio.h>
- X
- Xstatic char sccsid[] = "@(#) detab.c 1.4 10/18/89 21:52:21";
- X
- Xmain()
- X{
- X register int c; /* character buffer */
- X register int ccount = 0; /* nr of characters printed on current line */
- X
- X while ((c = getchar()) != EOF) {
- X switch (c) {
- X case '\r':
- X case '\n': putchar(c);
- X ccount = 0;
- X break;
- X case '\t': do { putchar(' '); } while (++ccount & 7);
- X break;
- X default: putchar(c);
- X ccount++;
- X break;
- X }
- X }
- X exit(0);
- X}
- END_OF_aux/detab.c
- if test 1170 -ne `wc -c <aux/detab.c`; then
- echo shar: \"aux/detab.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f aux/makefile -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"aux/makefile\"
- else
- echo shar: Extracting \"aux/makefile\" \(167 characters\)
- sed "s/^X//" >aux/makefile <<'END_OF_aux/makefile'
- X# @(#) makefile 2.1 90/01/22 14:06:29
- X
- XFILES = README detab.c makefile srctoman.sh
- X
- Xall: srctoman detab
- X
- Xshar: $(FILES)
- X shar $(FILES)
- X
- Xarchive:
- X $(ARCHIVE) $(FILES)
- X
- END_OF_aux/makefile
- if test 167 -ne `wc -c <aux/makefile`; then
- echo shar: \"aux/makefile\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d daemon ; then
- echo shar: Creating directory \"daemon\"
- mkdir daemon
- fi
- if test -f daemon/README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/README\"
- else
- echo shar: Extracting \"daemon/README\" \(221 characters\)
- sed "s/^X//" >daemon/README <<'END_OF_daemon/README'
- X@(#) README 1.8 12/29/89 18:12:55
- X
- XThis directory contains the daemon programs that run on a file server
- Xthat exports per-user pc-mail directories. The documentation assumes
- Xthat the UNIX hosts runs the sendmail program.
- END_OF_daemon/README
- if test 221 -ne `wc -c <daemon/README`; then
- echo shar: \"daemon/README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/dosunix.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/dosunix.h\"
- else
- echo shar: Extracting \"daemon/dosunix.h\" \(779 characters\)
- sed "s/^X//" >daemon/dosunix.h <<'END_OF_daemon/dosunix.h'
- X/*++
- X/* NAME
- X/* dosunix 5
- X/* SUMMARY
- X/* UNIX <-> MS-DOS text format conversion
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include <stdio.h>
- X/* #include "dosunix.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* Anticipate ANSI-compatible compilers */
- X
- X#ifdef __STDC__
- Xint unix2dos(FILE * ifp, FILE * ofp);
- Xint dos2unix(FILE * dfp, FILE * pfp);
- Xchar *dosgets(char *buf, int len, FILE * fp);
- X
- X#else
- Xint unix2dos();
- Xint dos2unix();
- Xchar *dosgets();
- X
- X#endif
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 16:41:50 MET 1989
- X/* LAST MODIFICATION
- X/* 10/29/89 22:30:05
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/dosunix.h
- if test 779 -ne `wc -c <daemon/dosunix.h`; then
- echo shar: \"daemon/dosunix.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/ms_parse.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/ms_parse.h\"
- else
- echo shar: Extracting \"daemon/ms_parse.h\" \(888 characters\)
- sed "s/^X//" >daemon/ms_parse.h <<'END_OF_daemon/ms_parse.h'
- X/*++
- X/* NAME
- X/* ms_parse 5
- X/* SUMMARY
- X/* message parser
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include "ms_parse.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* status codes returned by ms_parse() */
- X
- X#define MS_UUCP 0 /* UUCP-style From_ line */
- X#define MS_HEADER 1 /* RFC822-like header line */
- X#define MS_CONT 2 /* Continued header line */
- X#define MS_BODY 3 /* Line within message body */
- X
- X /* entry points of the ms_parse module */
- X
- Xextern int hscanf(); /* extract info from header line */
- Xextern int ms_parse(); /* parse one line */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Dec 9 18:50:35 MET 1989
- X/* LAST MODIFICATION
- X/* 1/6/90 19:45:22
- X/* VERSION/RELEASE
- X/* 1.6
- X/*--*/
- END_OF_daemon/ms_parse.h
- if test 888 -ne `wc -c <daemon/ms_parse.h`; then
- echo shar: \"daemon/ms_parse.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/mtime.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/mtime.h\"
- else
- echo shar: Extracting \"daemon/mtime.h\" \(943 characters\)
- sed "s/^X//" >daemon/mtime.h <<'END_OF_daemon/mtime.h'
- X/*++
- X/* NAME
- X/* mtime 5
- X/* SUMMARY
- X/* maintain modification times of files
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include "mtime.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* structure of one symbol-table entry */
- X
- Xtypedef struct MTIME {
- X char *path; /* key */
- X long time; /* value */
- X struct MTIME *left; /* left subtree */
- X struct MTIME *rite; /* right subtree */
- X} MTIME;
- X
- X /* client interface */
- X
- X#define mtime(path) (mtime_tree = findtime(path,mtime_tree))
- X
- X /* actual interface */
- X
- Xextern MTIME *mtime_tree; /* head of symbol table */
- XMTIME *findtime(); /* actual access function */
- X
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 15:48:01 MET 1989
- X/* LAST MODIFICATION DATE
- X/* 10/29/89 22:29:58
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/mtime.h
- if test 943 -ne `wc -c <daemon/mtime.h`; then
- echo shar: \"daemon/mtime.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/percentm.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/percentm.c\"
- else
- echo shar: Extracting \"daemon/percentm.c\" \(1708 characters\)
- sed "s/^X//" >daemon/percentm.c <<'END_OF_daemon/percentm.c'
- X/*++
- X/* NAME
- X/* percentm 3
- X/* SUMMARY
- X/* convert %m to system error message
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include percentm.h
- X/*
- X/* char *percentm(string, err)
- X/* char *string;
- X/* int err;
- X/* DESCRIPTION
- X/* percentm() interprets %m format specificiers in \fIstring\fR
- X/* In the output, %m will be replaced by the error message that
- X/* corresponds with the error value \fIerr\fR (see <errno.h>.
- X/* BUGS
- X/* The result is stored in static memory that is overwritten with
- X/* each call.
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 15:29:37 MET 1989
- X/* LAST MODIFICATION
- X/* 12/5/89 22:03:27
- X/* VERSION/RELEASE
- X/* 1.2
- X/*--*/
- X
- X#ifndef lint
- Xstatic char sccsid[] = "@(#) percentm.c 1.2 12/5/89 22:03:27";
- X
- X#endif
- X
- X#include <stdio.h>
- X#include "percentm.h"
- X
- Xextern int errno;
- Xextern char *sys_errlist[];
- Xextern int sys_nerr;
- Xextern char *strcpy();
- X
- X/* percentm - replace %m by error message associated with value in err */
- X
- Xchar *percentm(str, err)
- Xchar *str;
- Xint err;
- X{
- X static char buf[BUFSIZ];
- X register char *ip = str;
- X register char *op = buf;
- X
- X while (*ip) {
- X switch (*ip) {
- X case '%':
- X switch (ip[1]) {
- X case '\0': /* don't fall off end */
- X *op++ = *ip++;
- X break;
- X case 'm': /* replace %m */
- X (void) strcpy(op,
- X sys_errlist[(err < sys_nerr && err > 0) ? err : 0]);
- X op += strlen(op);
- X ip += 2;
- X break;
- X default: /* leave %<any> alone */
- X *op++ = *ip++, *op++ = *ip++;
- X break;
- X }
- X default:
- X *op++ = *ip++;
- X }
- X }
- X *op = '\0';
- X return (buf);
- X}
- X
- END_OF_daemon/percentm.c
- if test 1708 -ne `wc -c <daemon/percentm.c`; then
- echo shar: \"daemon/percentm.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/percentm.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/percentm.h\"
- else
- echo shar: Extracting \"daemon/percentm.h\" \(562 characters\)
- sed "s/^X//" >daemon/percentm.h <<'END_OF_daemon/percentm.h'
- X/*++
- X/* NAME
- X/* percentm 5
- X/* SUMMARY
- X/* convert %m to system error message
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include percentm.h
- X/* DESCRIPTION
- X/* .nf
- X
- X /* external interface of the percentm module */
- X
- Xextern char *percentm();
- X
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 15:29:37 MET 1989
- X/* LAST MODIFICATION
- X/* 10/29/89 22:31:53
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/percentm.h
- if test 562 -ne `wc -c <daemon/percentm.h`; then
- echo shar: \"daemon/percentm.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/sysexits.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/sysexits.h\"
- else
- echo shar: Extracting \"daemon/sysexits.h\" \(972 characters\)
- sed "s/^X//" >daemon/sysexits.h <<'END_OF_daemon/sysexits.h'
- X/*++
- X/* NAME
- X/* sysexits 5
- X/* SUMMARY
- X/* exit status codes for programs called by sendmail
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include "sysexits.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* sendmail-compatible exit status codes */
- X
- X#define EX_OK 0
- X#define EX_USAGE 64
- X#define EX_DATAERR 65
- X#define EX_NOINPUT 66
- X#define EX_NOUSER 67
- X#define EX_NOHOST 68
- X#define EX_UNAVAILABLE 69
- X#define EX_SOFTWARE 70
- X#define EX_OSERR 71
- X#define EX_OSFILE 72
- X#define EX_CANTCREAT 73
- X#define EX_IOERR 74
- X#define EX_TEMPFAIL 75
- X#define EX_PROTOCOL 76
- X#define EX_NOPERM 77
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/*
- X/* These codes were actually defined by Eric Allman, the originator
- X/* of the sendmail program.
- X/* CREATION DATE
- X/* Sun Oct 29 16:03:19 MET 1989
- X/* LAST MODIFICATION
- X/* 10/29/89 22:29:47
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/sysexits.h
- if test 972 -ne `wc -c <daemon/sysexits.h`; then
- echo shar: \"daemon/sysexits.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/syslog.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/syslog.h\"
- else
- echo shar: Extracting \"daemon/syslog.h\" \(698 characters\)
- sed "s/^X//" >daemon/syslog.h <<'END_OF_daemon/syslog.h'
- X/*++
- X/* NAME
- X/* syslog 5
- X/* SUMMARY
- X/* surrogate BSD4.3 syslog facility
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* include "syslog.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* Do nothing if we already have <syslog.h> */
- X
- X#ifndef SYSLOG
- X
- X /* various constants */
- X
- X#define LOG_PID 1
- X#define LOG_MAIL 1
- X#define LOG_WARNING 1
- X
- Xextern openlog();
- Xextern syslog();
- Xextern closelog();
- X
- X#endif
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 15:12:57 MET 1989
- X/* LAST MODIFICATION
- X/* 10/29/89 22:29:50
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/syslog.h
- if test 698 -ne `wc -c <daemon/syslog.h`; then
- echo shar: \"daemon/syslog.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f daemon/util.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"daemon/util.h\"
- else
- echo shar: Extracting \"daemon/util.h\" \(1060 characters\)
- sed "s/^X//" >daemon/util.h <<'END_OF_daemon/util.h'
- X/*++
- X/* NAME
- X/* util 3
- X/* SUMMARY
- X/* wrappers around standard library functions
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* nfs
- X/* SYNOPSIS
- X/* #include <stdio.h>
- X/* #include <pwd.h>
- X/* #include "util.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* Anticipate on ANSI-compatible compilers */
- X
- X#ifdef __STDC__
- XFILE *u_fopen(struct passwd * user, char *file, char *mode);
- Xint u_unlink(char *file);
- XDIR *e_opendir(char *path);
- Xint e_chdir(char *path);
- Xint e_fork(void);
- X
- X#else
- XFILE *u_fopen(); /* open file, log any errors */
- Xint u_unlink(); /* unlink file, log any errors */
- XDIR *e_opendir(); /* open directory, log any errors */
- Xint e_chdir(); /* change directory, log any errors */
- Xint e_fork(); /* fork, log any errors */
- X
- X#endif
- X/* AUTHOR(S)
- X/* Wietse Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Oct 29 16:21:02 MET 1989
- X/* LAST MODIFICATION
- X/* 10/29/89 22:29:55
- X/* VERSION/RELEASE
- X/* 1.1
- X/*--*/
- X
- END_OF_daemon/util.h
- if test 1060 -ne `wc -c <daemon/util.h`; then
- echo shar: \"daemon/util.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d main ; then
- echo shar: Creating directory \"main\"
- mkdir main
- fi
- if test -f main/Beware -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/Beware\"
- else
- echo shar: Extracting \"main/Beware\" \(827 characters\)
- sed "s/^X//" >main/Beware <<'END_OF_main/Beware'
- X@(#) Beware 2.1 90/01/22 13:01:03
- X
- XMicroSoft decided to change the order of function arguments of the C
- Xrename() function. Check the source against the documentation of your
- Xcompiler.
- X
- XIn order to handle messages larger than about 10 kbyte, the mail program
- Xwill have to be compiled with the large memory model.
- X
- XSince the assembly-language serial port driver assumes a small memory
- Xmodel, the cico program will have to be compiled with the small memory
- Xmodel as well.
- X
- XThe MAILDIR, EDITOR environment variables should hold absolute path
- Xnames. On MS-DOS systems (floppies!) it is a good idea to include the
- Xdrive name as well.
- X
- XOn some MS-DOS systems the root directory has no "." and ".." entries,
- Xand subdirectories directly below the root directory have no ".."
- Xentry. This only has consequences for the "File" command.
- END_OF_main/Beware
- if test 827 -ne `wc -c <main/Beware`; then
- echo shar: \"main/Beware\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/README\"
- else
- echo shar: Extracting \"main/README\" \(704 characters\)
- sed "s/^X//" >main/README <<'END_OF_main/README'
- X@(#) README 2.1 90/01/22 13:01:10
- X
- XThis directory contains sources and documentation for all software that
- Xmay run on a personal machine. There are three installation documents:
- X
- XDEFAULT.ins Describes how to install pc-mail using the default UUCP
- X dial-up and file-transfer software.
- X
- XSLAVE.ins Describes how to install pc-mail in a networked environment
- X that uses PC/NFS. The file server software is provided, and
- X described, in the `daemon' subdirectory.
- X
- XGNUUCP.ins For the enterprising hacker; describes how to install
- X pc-mail for use with the GNUUCP software.
- X
- XAn tutorial is available in the file `tutorial.ms'. A formatted version
- Xof this document can be found in the file `tutorial.doc'.
- END_OF_main/README
- if test 704 -ne `wc -c <main/README`; then
- echo shar: \"main/README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/ascf.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/ascf.h\"
- else
- echo shar: Extracting \"main/ascf.h\" \(1058 characters\)
- sed "s/^X//" >main/ascf.h <<'END_OF_main/ascf.h'
- X/*++
- X/* NAME
- X/* ascf 5
- X/* SUMMARY
- X/* stdio-like ascii filter
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* ascii filtering
- X/* SYNOPSIS
- X/* #include <stdio.h>
- X/* #include "ascf.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* An _iobuf-like structure for buffer management */
- X
- Xtypedef struct {
- X char *buf; /* intermediate buffer */
- X char *ptr; /* read pointer */
- X int cnt; /* buffer size */
- X char nlf; /* last newline kludge */
- X} Asc;
- X
- X#define ascget(p) (--asc[fileno(p)].cnt>=0?*asc[fileno(p)].ptr++&0377:ascbuf(p))
- X#define ascpbk(c,p) (asc[fileno(p)].cnt++, (*--asc[fileno(p)].ptr = c))
- X
- Xextern FILE *ascopen(); /* open filtered stream */
- Xextern Asc asc[]; /* buffers, status etc. */
- Xextern char *ascgets(); /* read string, strip crlf */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Mon Jul 6 16:03:41 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:01:15
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/ascf.h
- if test 1058 -ne `wc -c <main/ascf.h`; then
- echo shar: \"main/ascf.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/clmap.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/clmap.h\"
- else
- echo shar: Extracting \"main/clmap.h\" \(972 characters\)
- sed "s/^X//" >main/clmap.h <<'END_OF_main/clmap.h'
- X/* Map names to lower case for the MicroSoft 3.0 CL compiler/linker command */
- X
- X#define set_tty SET_TTY /* find current settings, and initialize */
- X#define reset_tty RESET_TTY /* reset to settings that set_tty() found */
- X#define get_msr GET_MSR /* get MSR byte from port. */
- X#define init_comm INIT_COMM /* initialize the comm port interupts, */
- X#define uninit_comm UNINIT_COMM /* remove initialization, */
- X#define set_xoff SET_XOFF /* enable/disable XON/XOFF, */
- X#define get_xoff GET_XOFF /* read XON/XOFF state, */
- X#define rcvd_xoff RCVD_XOFF /* returns true if XOFF rcvd, */
- X#define sent_xoff SENT_XOFF /* true if XOFF sent, */
- X#define inp_cnt INP_CNT /* returns count of rcv chars, */
- X#define inp_char INP_CHAR /* get one char from buffer, */
- X#define inp_flush INP_FLUSH /* flush input buffer, */
- X#define outp_char OUTP_CHAR /* output a character, */
- END_OF_main/clmap.h
- if test 972 -ne `wc -c <main/clmap.h`; then
- echo shar: \"main/clmap.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/comm.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/comm.c\"
- else
- echo shar: Extracting \"main/comm.c\" \(1193 characters\)
- sed "s/^X//" >main/comm.c <<'END_OF_main/comm.c'
- X/*++
- X/* NAME
- X/* comm 3
- X/* SUMMARY
- X/* cico communications parameters retrieval
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* cico
- X/* SYNOPSIS
- X/* #include "params.h"
- X/* #include "comm.h"
- X/* DESCRIPTION
- X/* Implementation module for communications parameters and other
- X/* global stuff that has not yet found its place.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Apr 12 13:37:12 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:01:20
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include <stdio.h>
- X
- X#include "defs.h"
- X#include "params.h"
- X#include "comm.h"
- X
- Xpublic int ttfd = -1; /* comm. port */
- Xpublic Info *comm = 0; /* comm. info */
- Xpublic char *password = 0; /* uucp password */
- Xpublic char rmthost[BUFSIZ] = "Unknown"; /* remote host name */
- X
- Xpublic int (*Read)() = 0; /* protocol read function */
- Xpublic int (*Write)() = 0; /* protocol write function */
- Xpublic int (*Close)() = 0; /* protocol close function */
- X
- Xpublic char msgin[MSGBUF]; /* message receive buffer */
- Xpublic char msgout[MSGBUF]; /* message send buffer */
- END_OF_main/comm.c
- if test 1193 -ne `wc -c <main/comm.c`; then
- echo shar: \"main/comm.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/deskutil.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/deskutil.h\"
- else
- echo shar: Extracting \"main/deskutil.h\" \(717 characters\)
- sed "s/^X//" >main/deskutil.h <<'END_OF_main/deskutil.h'
- X/*++
- X/* NAME
- X/* deskutil 5
- X/* SUMMARY
- X/* visible desk top utility funtions
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mailsh
- X/* SYNOPSIS
- X/* #include "deskutil.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X/* /* externally visible functions in deskutil.c */
- X
- Xextern void patience();
- Xextern int when();
- Xextern int unspool();
- Xextern int save();
- Xextern int print();
- Xextern int delete();
- X/* SEE ALSO
- X/* desk(3);
- X/* AUTHOR(S);
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Tue May 12 15:35:20 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 1/22/90 13:01:33
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/deskutil.h
- if test 717 -ne `wc -c <main/deskutil.h`; then
- echo shar: \"main/deskutil.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/hsearch.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/hsearch.h\"
- else
- echo shar: Extracting \"main/hsearch.h\" \(499 characters\)
- sed "s/^X//" >main/hsearch.h <<'END_OF_main/hsearch.h'
- X/* hsearch.c --- PD simple implementation of System V hsearch(3c) routine */
- X
- X /*
- X * Original author: Arnold Robbins
- X *
- X * Changes by me (WZV):
- X *
- X * put this part of the original hsearch.c in a separate file
- X *
- X * make the lookup and hashing algorithms case-insensitive
- X */
- X
- X#include <stdio.h>
- X
- Xtypedef struct entry {
- X char *key;
- X char *data;
- X } ENTRY;
- X
- Xtypedef enum {
- X FIND,
- X ENTER
- X } ACTION;
- X
- Xtypedef struct element {
- X ENTRY item;
- X struct element *next;
- X } ELEMENT;
- X
- XENTRY *hsearch();
- END_OF_main/hsearch.h
- if test 499 -ne `wc -c <main/hsearch.h`; then
- echo shar: \"main/hsearch.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/kbdinp.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/kbdinp.h\"
- else
- echo shar: Extracting \"main/kbdinp.h\" \(731 characters\)
- sed "s/^X//" >main/kbdinp.h <<'END_OF_main/kbdinp.h'
- X/*++
- X/* NAME
- X/* kbdinp
- X/* SUMMARY
- X/* keyboard interpreter definitions
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* #include "kbdinp.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* keyboard interpreter function types */
- X
- Xextern int kbdinp(); /* interpreter */
- Xextern void kbdinit(); /* set terminal modes */
- Xextern void kbdrest(); /* restore terminal modes */
- X
- X/* SEE ALSO
- X/* kbdinp(3) keyboard interpreter implementation
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Apr 4 19:12:01 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:01:53
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/kbdinp.h
- if test 731 -ne `wc -c <main/kbdinp.h`; then
- echo shar: \"main/kbdinp.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/logs.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/logs.h\"
- else
- echo shar: Extracting \"main/logs.h\" \(851 characters\)
- sed "s/^X//" >main/logs.h <<'END_OF_main/logs.h'
- X/*++
- X/* NAME
- X/* logs 5
- X/* SUMMARY
- X/* various message services
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* cico
- X/* SYNOPSIS
- X/* #include "logs.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* globally visible components */
- X
- X#define debug(l) (dflag >= l) && dbg /* yuck! */
- X
- Xextern int dflag; /* debugging level */
- Xextern int *systrap; /* panic button */
- X
- Xextern void trap(); /* exception handler */
- Xextern int open_log(); /* open log file */
- Xextern int dbg(); /* write debug info */
- Xextern void log(); /* write logging info */
- X
- X/* FILES
- X/* $MAILDIR/logfile
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Apr 12 13:45:11 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:03
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/logs.h
- if test 851 -ne `wc -c <main/logs.h`; then
- echo shar: \"main/logs.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/mail.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/mail.h\"
- else
- echo shar: Extracting \"main/mail.h\" \(1592 characters\)
- sed "s/^X//" >main/mail.h <<'END_OF_main/mail.h'
- X/*++
- X/* NAME
- X/* mail 5
- X/* SUMMARY
- X/* global declarations for mail shell
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* #include "mail.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* Global declarations for the mail shell */
- X
- Xextern int alias(); /* alias.c */
- Xextern int call(); /* call.c */
- Xextern int create(); /* create.c */
- Xextern void init(); /* desk.c */
- Xextern int junk_desk(); /* desk.c */
- Xextern char message[]; /* desk.c */
- Xextern char comment[]; /* desk.c */
- Xextern void patience(); /* deskutil.c */
- Xextern int when(); /* deskutil.c */
- Xextern int unspool(); /* deskutil.c */
- Xextern int save(); /* deskutil.c */
- Xextern int filter(); /* deskutil.c */
- Xextern int print(); /* deskutil.c */
- Xextern int delete(); /* deskutil.c */
- Xextern char *tstamp(); /* deskutil.c */
- Xextern int edit(); /* edit.c */
- Xextern int work(); /* email.c */
- Xextern int work_disp(); /* email.c */
- Xextern int file(); /* file.c */
- Xextern int junk_file(); /* file.c */
- Xextern int kbdinp(); /* kbdinp.c */
- Xextern void kbdinit(); /* kbdinp.c */
- Xextern void kbdrest(); /* kbdinp.c */
- Xextern int mailfile(); /* mailfile.c */
- Xextern int makework(); /* makework.c */
- Xextern int mbox(); /* mbox.c */
- Xextern int reply(); /* reply.c */
- Xextern int setup(); /* setup.c */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Apr 16 16:42:07 MET 1988
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:05
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/mail.h
- if test 1592 -ne `wc -c <main/mail.h`; then
- echo shar: \"main/mail.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/ms_parse.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/ms_parse.h\"
- else
- echo shar: Extracting \"main/ms_parse.h\" \(898 characters\)
- sed "s/^X//" >main/ms_parse.h <<'END_OF_main/ms_parse.h'
- X/*++
- X/* NAME
- X/* ms_parse 5
- X/* SUMMARY
- X/* message parser
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mailsh
- X/* SYNOPSIS
- X/* #include "ms_parse.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* status codes returned by ms_parse() */
- X
- X#define MS_UUCP 0 /* UUCP-style From_ line */
- X#define MS_HEADER 1 /* RFC822-like header line */
- X#define MS_CONT 2 /* Continued header line */
- X#define MS_BODY 3 /* Line within message body */
- X
- X /* entry points of the ms_parse module */
- X
- Xextern int hscanf(); /* extract info from header line */
- Xextern int ms_parse(); /* parse one line */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Dec 9 18:50:35 MET 1989
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:13
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/ms_parse.h
- if test 898 -ne `wc -c <main/ms_parse.h`; then
- echo shar: \"main/ms_parse.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/msd_dir.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/msd_dir.h\"
- else
- echo shar: Extracting \"main/msd_dir.h\" \(954 characters\)
- sed "s/^X//" >main/msd_dir.h <<'END_OF_main/msd_dir.h'
- X/*
- X * @(#)msd_dir.h 1.4 87/11/06 Public Domain.
- X *
- X * A public domain implementation of BSD directory routines for
- X * MS-DOS. Written by Michael Rendell ({uunet,utai}michael@garfield),
- X * August 1897
- X */
- X
- X#define rewinddir(dirp) seekdir(dirp, 0L)
- X
- X#define MAXNAMLEN 12
- X
- Xstruct direct {
- X ino_t d_ino; /* a bit of a farce */
- X int d_reclen; /* more farce */
- X int d_namlen; /* length of d_name */
- X char d_name[MAXNAMLEN + 1]; /* garentee null termination */
- X};
- X
- Xstruct _dircontents {
- X char *_d_entry;
- X struct _dircontents *_d_next;
- X};
- X
- Xtypedef struct _dirdesc {
- X int dd_id; /* uniquely identify each open directory */
- X long dd_loc; /* where we are in directory entry is this */
- X struct _dircontents *dd_contents; /* pointer to contents of dir */
- X struct _dircontents *dd_cp; /* pointer to current position */
- X} DIR;
- X
- Xextern DIR *opendir();
- Xextern struct direct *readdir();
- Xextern void seekdir();
- Xextern long telldir();
- Xextern void closedir();
- END_OF_main/msd_dir.h
- if test 954 -ne `wc -c <main/msd_dir.h`; then
- echo shar: \"main/msd_dir.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/myalloc.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/myalloc.c\"
- else
- echo shar: Extracting \"main/myalloc.c\" \(999 characters\)
- sed "s/^X//" >main/myalloc.c <<'END_OF_main/myalloc.c'
- X#include <stdio.h>
- X#include <varargs.h>
- X
- Xextern char *progname;
- X
- X#include "defs.h"
- X
- X/* fatal - another way to terminate */
- X
- X/* VARARGS */
- X
- Xpublic fatal(va_alist)
- Xva_dcl
- X{
- X va_list ap;
- X char *fmt;
- X
- X if (progname && *progname)
- X (void) fprintf(stderr, "%s: ", progname);
- X va_start(ap);
- X fmt = va_arg(ap, char *);
- X (void) vfprintf(stderr, fmt, ap);
- X va_end(ap);
- X (void) abort();
- X exit(1);
- X}
- X
- X/* myalloc - allocate memory or terminate */
- X
- Xpublic char *myalloc(size)
- Xunsigned size;
- X{
- X register char *p;
- X char *malloc();
- X
- X if ((p = malloc(size)) == 0)
- X fatal("memory allocation error");
- X return (p);
- X}
- X
- X/* myrealloc - extend memory or terminate (allows NULL pointer) */
- X
- Xpublic char *myrealloc(ptr, size)
- Xchar *ptr;
- Xunsigned size;
- X{
- X register char *p;
- X char *realloc();
- X
- X if (ptr == 0) {
- X return (myalloc(size));
- X } else if ((p = realloc(ptr, size)) == 0) {
- X fatal("memory allocation error");
- X /* NOTREACHED */
- X } else {
- X return (p);
- X }
- X}
- END_OF_main/myalloc.c
- if test 999 -ne `wc -c <main/myalloc.c`; then
- echo shar: \"main/myalloc.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/ndir.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/ndir.c\"
- else
- echo shar: Extracting \"main/ndir.c\" \(1729 characters\)
- sed "s/^X//" >main/ndir.c <<'END_OF_main/ndir.c'
- X/* This source was taken from the rn program by Larry Wall */
- X
- X#ifdef USENDIR
- X#include <sys/types.h>
- X#include "ndir.h"
- X
- X/*
- X * support for Berkeley directory reading routine on a V7 file system
- X */
- X
- X/*
- X * open a directory.
- X */
- XDIR *
- Xopendir(name)
- Xchar *name;
- X{
- X register DIR *dirp;
- X register int fd;
- X char *malloc();
- X
- X if ((fd = open(name, 0)) == -1)
- X return NULL;
- X if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) {
- X close (fd);
- X return NULL;
- X }
- X dirp->dd_fd = fd;
- X dirp->dd_loc = 0;
- X return dirp;
- X}
- X
- X/*
- X * read an old style directory entry and present it as a new one
- X */
- X#ifndef pyr
- X#define ODIRSIZ 14
- X
- Xstruct olddirect {
- X ino_t od_ino;
- X char od_name[ODIRSIZ];
- X};
- X#else an Pyramid in the ATT universe
- X#define ODIRSIZ 248
- X
- Xstruct olddirect {
- X long od_ino;
- X short od_fill1, od_fill2;
- X char od_name[ODIRSIZ];
- X};
- X#endif
- X
- X/*
- X * get next entry in a directory.
- X */
- Xstruct direct *
- Xreaddir(dirp)
- Xregister DIR *dirp;
- X{
- X register struct olddirect *dp;
- X static struct direct dir;
- X
- X for (;;) {
- X if (dirp->dd_loc == 0) {
- X dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
- X DIRBLKSIZ);
- X if (dirp->dd_size <= 0)
- X return NULL;
- X }
- X if (dirp->dd_loc >= dirp->dd_size) {
- X dirp->dd_loc = 0;
- X continue;
- X }
- X dp = (struct olddirect *)(dirp->dd_buf + dirp->dd_loc);
- X dirp->dd_loc += sizeof(struct olddirect);
- X if (dp->od_ino == 0)
- X continue;
- X dir.d_ino = dp->od_ino;
- X strncpy(dir.d_name, dp->od_name, ODIRSIZ);
- X dir.d_name[ODIRSIZ] = '\0'; /* insure null termination */
- X dir.d_namlen = strlen(dir.d_name);
- X dir.d_reclen = DIRSIZ(&dir);
- X return (&dir);
- X }
- X}
- X
- X/*
- X * close a directory.
- X */
- Xvoid
- Xclosedir(dirp)
- Xregister DIR *dirp;
- X{
- X close(dirp->dd_fd);
- X dirp->dd_fd = -1;
- X dirp->dd_loc = 0;
- X free(dirp);
- X}
- X#endif USENDIR
- END_OF_main/ndir.c
- if test 1729 -ne `wc -c <main/ndir.c`; then
- echo shar: \"main/ndir.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/ndir.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/ndir.h\"
- else
- echo shar: Extracting \"main/ndir.h\" \(1386 characters\)
- sed "s/^X//" >main/ndir.h <<'END_OF_main/ndir.h'
- X/* This source was taken from the rn program by Larry Wall */
- X
- X#ifdef MSDOS
- X# include <sys/types.h>
- X# include "msd_dir.h"
- X#else
- X# ifdef LIBNDIR
- X# include <ndir.h>
- X# else
- X# ifndef USENDIR
- X# include <sys/types.h>
- X# include <sys/dir.h>
- X# else
- X
- X#ifndef DEV_BSIZE
- X#define DEV_BSIZE 512
- X#endif
- X#define DIRBLKSIZ DEV_BSIZE
- X#define MAXNAMLEN 255
- X
- Xstruct direct {
- X long d_ino; /* inode number of entry */
- X short d_reclen; /* length of this record */
- X short d_namlen; /* length of string in d_name */
- X char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */
- X};
- X
- X/*
- X * The DIRSIZ macro gives the minimum record length which will hold
- X * the directory entry. This requires the amount of space in struct direct
- X * without the d_name field, plus enough space for the name with a terminating
- X * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
- X */
- X#undef DIRSIZ
- X#define DIRSIZ(dp) \
- X ((sizeof (struct direct) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
- X
- X/*
- X * Definitions for library routines operating on directories.
- X */
- Xtypedef struct _dirdesc {
- X int dd_fd;
- X long dd_loc;
- X long dd_size;
- X char dd_buf[DIRBLKSIZ];
- X} DIR;
- X#ifndef NULL
- X#define NULL 0
- X#endif
- Xextern DIR *opendir();
- Xextern struct direct *readdir();
- Xextern long telldir();
- Xextern void seekdir();
- X#define rewinddir(dirp) seekdir((dirp), (long)0)
- Xextern void closedir();
- X
- X# endif
- X# endif
- X#endif
- END_OF_main/ndir.h
- if test 1386 -ne `wc -c <main/ndir.h`; then
- echo shar: \"main/ndir.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/screen.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/screen.c\"
- else
- echo shar: Extracting \"main/screen.c\" \(1635 characters\)
- sed "s/^X//" >main/screen.c <<'END_OF_main/screen.c'
- X/*++
- X/* NAME
- X/* screen 3
- X/* SUMMARY
- X/* often-used message strings
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* #include "screen.h"
- X/* DESCRIPTION
- X/* Messages and strings used in more than one Screen structure
- X/* are kept here.
- X/* SEE ALSO
- X/* screen(5) screen table structure
- X/* kbdinp(3) screen table interpreter
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Apr 1 21:14:53 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:34
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "defs.h"
- X#include "screen.h"
- X
- X/* general strings used in more than one Screen structure */
- X
- Xpublic char anykey[] = "Press any key to continue";
- Xpublic char initscreen[]= "Return to initial screen";
- Xpublic char prevscreen[]= "Return to previous screen";
- Xpublic char int_error[] = "The program is confused";
- Xpublic char pageup[] = "Move screen one page upwards";
- Xpublic char pagedn[] = "Move screen one page downwards";
- Xpublic char csrup[] = "Move cursor upwards";
- Xpublic char csrdn[] = "Move cursor downwards";
- Xpublic char getsummary[]= "Press ESC to cancel. Enter a one-line summary for identification:";
- Xpublic char getaddr[] = "Press ESC to cancel. Send message to:";
- Xpublic char printcurr[] = "Print this message";
- Xpublic char delcurr[] = "Delete this message";
- X
- X/* we have a problem reading a mail message */
- X
- Xpublic char *m_msgread[] = {
- X "",
- X "Sorry, that message is no longer available",
- X 0,
- X};
- END_OF_main/screen.c
- if test 1635 -ne `wc -c <main/screen.c`; then
- echo shar: \"main/screen.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/snapshot.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/snapshot.h\"
- else
- echo shar: Extracting \"main/snapshot.h\" \(841 characters\)
- sed "s/^X//" >main/snapshot.h <<'END_OF_main/snapshot.h'
- X/*++
- X/* NAME
- X/* snapshot 5
- X/* SUMMARY
- X/* keep overview of the mail directory
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* #include "snapshot.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* Storage for one message entry in the snapshot table */
- X
- Xtypedef struct {
- X unsigned short msgno; /* message sequence number */
- X char prefix; /* message name prefix */
- X} SNAP_SHOT;
- X
- X/* access functions */
- X
- Xpublic void snap_junk(); /* junk snapshot table */
- Xpublic SNAP_SHOT *snap_shot(); /* make sure shapshot exists */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Dec 17 19:51:55 MET 1989
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:39
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/snapshot.h
- if test 841 -ne `wc -c <main/snapshot.h`; then
- echo shar: \"main/snapshot.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/status.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/status.h\"
- else
- echo shar: Extracting \"main/status.h\" \(1700 characters\)
- sed "s/^X//" >main/status.h <<'END_OF_main/status.h'
- X/*++
- X/* NAME
- X/* status 5
- X/* SUMMARY
- X/* process termination status
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* library
- X/* SYNOPSIS
- X/* #include "status.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* process termination status codes */
- X
- X#define E_SUCCESS 0 /* successfull completion */
- X
- X#define E_SYSFAIL 41 /* operating system failure */
- X#define E_NOPROG 42 /* program not found */
- X#define E_NOSPOOL 43 /* no spool directory */
- X#define E_READERR 44 /* data file read error */
- X#define E_WRITERR 45 /* data file write error */
- X#define E_CONFUSED 46 /* internal error */
- X#define E_UNKNOWN 47 /* unknown error */
- X#define E_FILENO 48 /* cannot open enough files */
- X#define E_BADSETUP 49 /* bad setup parameter */
- X#define E_UNLINK 50 /* cannot remove file */
- X#define E_PRINTERR 51 /* printer error */
- X#define E_NOUSER 52 /* unknown user */
- X#define E_OVALIAS 53 /* alias expansion overflow */
- X#define E_TOOLONG 54 /* list of recipients too long */
- X
- X /* cico specific codes */
- X
- X#define E_NOLINE 61 /* cannot reach host */
- X#define E_NORESP 62 /* no ititial response */
- X#define E_REJECT 63 /* rejected by host (unknown,... ) */
- X#define E_LOST 64 /* link lost (timeout,...) */
- X/* SEE ALSO
- X/* status(3) error message implementation
- X/* BUGS
- X/* The usual error message problem: there is hardly any context
- X/* information. A read error is a read error, no info about the
- X/* state of processing when it ocurred.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Apr 11 15:45:37 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:42
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/status.h
- if test 1700 -ne `wc -c <main/status.h`; then
- echo shar: \"main/status.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/submit.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/submit.c\"
- else
- echo shar: Extracting \"main/submit.c\" \(1605 characters\)
- sed "s/^X//" >main/submit.c <<'END_OF_main/submit.c'
- X/*++
- X/* NAME
- X/* submit 3
- X/* SUMMARY
- X/* queue a message for transfer over the network
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* int submit(file,to)
- X/* char *file;
- X/* char *to;
- X/* DESCRIPTION
- X/* submit() invokes the smail command to prepare a message for
- X/* transmission across the network. file is the name of a file
- X/* with a message; to is a string with one or more destinations,
- X/* separated by blanks. The to string is modified.
- X/* FUNCTIONS AND MACROS
- X/* invokevp()
- X/* COMMANDS
- X/* smail, alias processing and queueing
- X/* FILES
- X/* d<seqno> message file
- X/* x<seqno> destination
- X/* SEE ALSO
- X/* path(5) spool file names
- X/* status(5) error status codes
- X/* DIAGNOSTICS
- X/* A nonzero error status is returned in case of problems.
- X/* BUGS
- X/* On some non-Unix systems the limit on the command-line length
- X/* may cause problems.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sat Apr 9 17:48:03 MET 1988
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:44
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include <stdio.h>
- X
- X#include "defs.h"
- X#include "path.h"
- X
- Xpublic int submit(file, to)
- Xchar *file;
- Xchar *to;
- X{
- X#ifdef lint
- X static
- X#endif
- X char *arglist[BUFSIZ];
- X register char **cpp = arglist;
- X static char sep[] = ", \t";
- X
- X /* Build the argment vector for the smail command */
- X
- X *cpp++ = SMAIL;
- X *cpp++ = file;
- X
- X for (*cpp = strtok(to, sep); *cpp; *++cpp = strtok((char *) 0, sep))
- X /* void */ ;
- X
- X return (invokevp(arglist));
- X}
- END_OF_main/submit.c
- if test 1605 -ne `wc -c <main/submit.c`; then
- echo shar: \"main/submit.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/sysdep.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/sysdep.h\"
- else
- echo shar: Extracting \"main/sysdep.h\" \(1096 characters\)
- sed "s/^X//" >main/sysdep.h <<'END_OF_main/sysdep.h'
- X/*++
- X/* NAME
- X/* sysdep 5
- X/* SUMMARY
- X/* system dependencies for comm. port i/o
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* cico
- X/* SYNOPSIS
- X/* #include "sysdep.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* try to unite unix and dos */
- X
- X#ifdef unix
- X#define xwrite write
- X#define xread read
- Xextern int xopen(),xclose(),xgetc();
- X#endif
- X
- X#ifdef MSDOS
- X#include <fcntl.h>
- X#include <signal.h>
- X#include <dos.h>
- X#include "comport.h"
- X#include "clmap.h"
- X
- Xtypedef struct timetype {
- X unsigned hour;
- X unsigned minute;
- X unsigned sec;
- X unsigned hsec;
- X} TIME, *TIME_PTR;
- X
- Xextern int xread(),xwrite(),xopen(),xclose(),xgetc();
- X#endif
- X
- X/* time-out interval serial-port i/o */
- X
- X#define BYTE_TIMEOUT 20
- X/* AUTHOR(S)
- X/* MS-DOS parts derived from uuslave sources (John Gilmore)
- X/* published on usenet early 1987.
- X/*
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Apr 12 17:48:08 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:47
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/sysdep.h
- if test 1096 -ne `wc -c <main/sysdep.h`; then
- echo shar: \"main/sysdep.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/textcopy.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/textcopy.c\"
- else
- echo shar: Extracting \"main/textcopy.c\" \(1234 characters\)
- sed "s/^X//" >main/textcopy.c <<'END_OF_main/textcopy.c'
- X/*++
- X/* NAME
- X/* textcopy 3
- X/* SUMMARY
- X/* copy text to stream
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* mail
- X/* SYNOPSIS
- X/* int textcopy(path, fp)
- X/* char *path;
- X/* FILE *fp;
- X/* DESCRIPTION
- X/* This function filters the contents of a file and writes the result
- X/* to a stdio stream. It can be used, for example, to provide optional
- X/* headers and trailers for new mail messages and for replies.
- X/* SEE ALSO
- X/* ascf(3) text filter
- X/* DIAGNOSTICS
- X/* A nonzero value is returned in case of problems.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Fri Dec 15 21:39:26 MET 1989
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:48
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include <stdio.h>
- X
- X#include "defs.h"
- X#include "ascf.h"
- X
- X/* textcopy - copy text to stream */
- X
- Xpublic int textcopy(path, fp)
- Xchar *path;
- XFILE *fp;
- X{
- X char buf[BUFSIZ];
- X int ret;
- X FILE *ip;
- X
- X if ((ip = ascopen(path, "r")) == 0) {
- X return (1);
- X } else {
- X while (ascgets(buf, sizeof(buf), ip))
- X fputs(buf, fp), putc('\n', fp);
- X ret = ferror(ip);
- X ascclose(ip);
- X return (ret);
- X }
- X}
- END_OF_main/textcopy.c
- if test 1234 -ne `wc -c <main/textcopy.c`; then
- echo shar: \"main/textcopy.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f main/work.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"main/work.h\"
- else
- echo shar: Extracting \"main/work.h\" \(1094 characters\)
- sed "s/^X//" >main/work.h <<'END_OF_main/work.h'
- X/*++
- X/* NAME
- X/* scanwork,rmtwork 5
- X/* SUMMARY
- X/* spool directory access for cico
- X/* PROJECT
- X/* pc-mail
- X/* PACKAGE
- X/* cico
- X/* SYNOPSIS
- X/* #include <stdio.h>
- X/* #include "work.h"
- X/* DESCRIPTION
- X/* .nf
- X
- X /* globally visible elements of scanwork.c */
- X
- Xtypedef struct {
- X char type; /* Data, eXecute */
- X char path[BUFSIZ]; /* full path name (unsent file) */
- X char sent[BUFSIZ]; /* full path name when sent */
- X unsigned seqno; /* sequence number */
- X char rqst[BUFSIZ]; /* uucp request message */
- X FILE *fp; /* associated file pointer */
- X} work;
- X
- Xextern work *scanwork(); /* searches work files */
- Xextern work *rmtwork(); /* assigns spool files */
- Xextern void getwork(); /* receives remote work */
- X
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Sun Apr 12 14:30:28 GMT+1:00 1987
- X/* LAST MODIFICATION
- X/* 90/01/22 13:02:58
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_main/work.h
- if test 1094 -ne `wc -c <main/work.h`; then
- echo shar: \"main/work.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test ! -d termcap ; then
- echo shar: Creating directory \"termcap\"
- mkdir termcap
- fi
- if test -f termcap/README -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/README\"
- else
- echo shar: Extracting \"termcap/README\" \(533 characters\)
- sed "s/^X//" >termcap/README <<'END_OF_termcap/README'
- X@(#) README 2.1 90/01/22 13:56:53
- X
- XMS-DOS Implementation notes, W.Z. Venema, Eindhoven University of Technology
- X
- XThe functions presented here implement UNIX-style terminal-independent
- Xoperation routines for cursor addressing, video attributes etc.
- X
- XThe functions are effective for the ibm pc console, and assume that the
- XMS-DOS driver ANSI.SYS is loaded. The capabilities for the console are
- Xstored in a static data structure.
- X
- XThe makefile is for Microsoft C; there is a batch file if your make
- Xdoes not grok UNIX-style makefiles.
- END_OF_termcap/README
- if test 533 -ne `wc -c <termcap/README`; then
- echo shar: \"termcap/README\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/buildall.bat -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/buildall.bat\"
- else
- echo shar: Extracting \"termcap/buildall.bat\" \(253 characters\)
- sed "s/^X//" >termcap/buildall.bat <<'END_OF_termcap/buildall.bat'
- Xcl -Ml -c tgoto.c
- Xcl -Ml -c tgetnum.c
- Xcl -Ml -c tgetstr.c
- Xcl -Ml -c tputs.c
- Xcl -Ml -c tgetflag.c
- Xcl -Ml -c tgetent.c
- Xcl -Ml -c console.c
- Xdel termcap.lib
- Xlib termcap.lib tgoto.obj tgetnum.obj tgetstr.obj tputs.obj tgetflag.obj tgetent.obj console.obj ;
- END_OF_termcap/buildall.bat
- if test 253 -ne `wc -c <termcap/buildall.bat`; then
- echo shar: \"termcap/buildall.bat\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/makefile.msc -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/makefile.msc\"
- else
- echo shar: Extracting \"termcap/makefile.msc\" \(497 characters\)
- sed "s/^X//" >termcap/makefile.msc <<'END_OF_termcap/makefile.msc'
- X# @(#) makefile.msc 2.1 90/01/22 13:57:00
- X
- XCFLAGS = -Ml
- XCC = cl
- X
- XFILES = README buildall.bat console.c makefile.msc termcap.h tgetent.c \
- X tgetflag.c tgetnum.c tgetstr.c tgoto.c tputs.c
- X
- XOBJECTS = tgoto.obj tgetnum.obj tgetstr.obj tputs.obj tgetflag.obj \
- X tgetent.obj console.obj
- X
- X.SUFFIXES: .obj
- X
- X.c.obj:
- X $(CC) $(CFLAGS) -c $*.c
- X
- Xtermcap.lib: $(OBJECTS)
- X del $@
- X lib $@ $(OBJECTS) ;
- X
- X$(OBJECTS): termcap.h
- X
- Xcleanup clean:
- X del $(OBJECTS)
- X
- Xclobber: clean
- X del termcap.lib
- X
- Xshar:
- X shar $(FILES)
- END_OF_termcap/makefile.msc
- if test 497 -ne `wc -c <termcap/makefile.msc`; then
- echo shar: \"termcap/makefile.msc\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/termcap.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/termcap.h\"
- else
- echo shar: Extracting \"termcap/termcap.h\" \(1066 characters\)
- sed "s/^X//" >termcap/termcap.h <<'END_OF_termcap/termcap.h'
- X/*++
- X/* NAME
- X/* termcap.h 5
- X/* SUMMARY
- X/* internal type declarations for termcap functions
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* #include "termcap.h"
- X/* DESCRIPTION
- X/* termcap.h contains declarations for internal use of the MS-DOS
- X/* implementation of the termcap(3) functions, assuming the
- X/* presence of the ANSI.SYS console driver.
- X/* .nf
- X
- X /* function types */
- X
- Xextern tgetent();
- Xextern tgetnum();
- Xextern tgetflag();
- Xextern char *tgetstr();
- Xextern char *tgoto();
- Xextern tputs();
- X
- X /* static storage for pc console capabilities */
- X
- Xtypedef struct {
- X char *name;
- X char *cap;
- X} Cap;
- X
- Xextern Cap _console[];
- X/* SEE ALSO
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:02
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- END_OF_termcap/termcap.h
- if test 1066 -ne `wc -c <termcap/termcap.h`; then
- echo shar: \"termcap/termcap.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tgetent.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tgetent.c\"
- else
- echo shar: Extracting \"termcap/tgetent.c\" \(1228 characters\)
- sed "s/^X//" >termcap/tgetent.c <<'END_OF_termcap/tgetent.c'
- X/*++
- X/* NAME
- X/* tgetent 3
- X/* SUMMARY
- X/* extract terminal entry from capability database
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* tgetent(bp,name)
- X/* char *bp,*name;
- X/* DESCRIPTION
- X/* tgetent simulates its UNIX counterpart.
- X/* Its purpose is to extract from the capability database all
- X/* information for a specific terminal.
- X/*
- X/* name should point to a string with the terminal name (usually
- X/* taken from the environment with getenv(3)).
- X/* bp should point to a 1024-character buffer for storage of
- X/* terminal information extracted from the capability database.
- X/*
- X/* Since the capabilities of the ms-dos console are described by a
- X/* static data structure, tgetent(3) is a dummy function.
- X/* SEE ALSO
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:04
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- Xtgetent(bp, name)
- Xchar *bp,
- X *name;
- X{
- X return (1);
- X}
- END_OF_termcap/tgetent.c
- if test 1228 -ne `wc -c <termcap/tgetent.c`; then
- echo shar: \"termcap/tgetent.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tgetflag.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tgetflag.c\"
- else
- echo shar: Extracting \"termcap/tgetflag.c\" \(1005 characters\)
- sed "s/^X//" >termcap/tgetflag.c <<'END_OF_termcap/tgetflag.c'
- X/*++
- X/* NAME
- X/* tgetflag 3
- X/* SUMMARY
- X/* check for existence of capability
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* tgetflag(name)
- X/* char *name;
- X/* DESCRIPTION
- X/* tgetflag is a predicate function that evaluates to "true" when
- X/* the capablity in "name" is present in the terminal info extracted
- X/* earlier with tgetent(3).
- X/* SEE ALSO
- X/* tgetent(3), extracts terminal info from database.
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:09
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- Xtgetflag(id)
- Xregister char *id;
- X{
- X register Cap *p;
- X
- X for (p = _console; *p->name; p++)
- X if (strcmp(id, p->name) == 0)
- X return 1;
- X return 0;
- X}
- END_OF_termcap/tgetflag.c
- if test 1005 -ne `wc -c <termcap/tgetflag.c`; then
- echo shar: \"termcap/tgetflag.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tgetnum.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tgetnum.c\"
- else
- echo shar: Extracting \"termcap/tgetnum.c\" \(1024 characters\)
- sed "s/^X//" >termcap/tgetnum.c <<'END_OF_termcap/tgetnum.c'
- X/*++
- X/* NAME
- X/* tgetnum 3
- X/* SUMMARY
- X/* extract numerical capability from terminal database
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* tgetnum(name)
- X/* char *name;
- X/* DESCRIPTION
- X/* tgetnum extracts the numerical value associated with the
- X/* capability in "name", for the terminal info extracted with
- X/* a previous call of tgetent(3).
- X/* SEE ALSO
- X/* tgetent(3), extract terminal entry from database.
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:11
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- Xtgetnum(id)
- Xregister char *id;
- X{
- X register Cap *p;
- X
- X for (p = _console; *p->name; p++)
- X if (strcmp(id, p->name) == 0)
- X return atoi(p->cap);
- X return -1;
- X}
- END_OF_termcap/tgetnum.c
- if test 1024 -ne `wc -c <termcap/tgetnum.c`; then
- echo shar: \"termcap/tgetnum.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tgetstr.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tgetstr.c\"
- else
- echo shar: Extracting \"termcap/tgetstr.c\" \(1307 characters\)
- sed "s/^X//" >termcap/tgetstr.c <<'END_OF_termcap/tgetstr.c'
- X/*++
- X/* NAME
- X/* tgetstr 3
- X/* SUMMARY
- X/* extract string-valued capability from terminal database
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* char *tgetstr(name,area)
- X/* char *name,**area;
- X/* DESCRIPTION
- X/* tgetstr extracts the string value associated with the capability
- X/* in "name", from the info obtained earlier through a call of
- X/* tgetent(3). area is a pointer to a 1024-character buffer and is
- X/* updated with each call of tgetstr(3).
- X/*
- X/* Since the capabilities of the ms-dos console are stored in a static
- X/* data structure,
- X/* the area pointer is not used in the MS-DOS implementation.
- X/* SEE ALSO
- X/* tgetent(3), extract terminal entry from database.
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:13
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- Xchar *tgetstr(id, area)
- Xregister char *id;
- Xchar **area;
- X{
- X register Cap *p;
- X
- X for (p = _console; *p->name; p++)
- X if (strcmp(id, p->name) == 0)
- X return (p->cap);
- X return 0;
- X}
- END_OF_termcap/tgetstr.c
- if test 1307 -ne `wc -c <termcap/tgetstr.c`; then
- echo shar: \"termcap/tgetstr.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tgoto.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tgoto.c\"
- else
- echo shar: Extracting \"termcap/tgoto.c\" \(1376 characters\)
- sed "s/^X//" >termcap/tgoto.c <<'END_OF_termcap/tgoto.c'
- X/*++
- X/* NAME
- X/* tgoto 3
- X/* SUMMARY
- X/* absolute cursor addressing
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* char *tgoto(cm,destcol,destline)
- X/* char *cm;
- X/* int destcol,destline;
- X/* DESCRIPTION
- X/* tgoto(3) returns a character string for absolute cursor addressing.
- X/* Usually, the string is constructed on the basis of the "cm" capability
- X/* extracted from the terminal capability database.
- X/*
- X/* In the ms-dos implementation cursor addressing is hardwired into
- X/* the tgoto(3) algorithm.
- X/* SEE ALSO
- X/* tgetstr(3) Extracts string capability from data base
- X/* termcap(3) Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:19
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- X/* version with wired-in cursor movement */
- X
- Xchar *tgoto(cm, destcol, destline)
- Xchar *cm;
- Xint destcol;
- Xint destline;
- X{
- X static char buf[100];
- X
- X (void) sprintf(buf, "\033[%d;%dH", destline + 1, destcol + 1);
- X return buf;
- X}
- END_OF_termcap/tgoto.c
- if test 1376 -ne `wc -c <termcap/tgoto.c`; then
- echo shar: \"termcap/tgoto.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f termcap/tputs.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"termcap/tputs.c\"
- else
- echo shar: Extracting \"termcap/tputs.c\" \(1036 characters\)
- sed "s/^X//" >termcap/tputs.c <<'END_OF_termcap/tputs.c'
- X/*++
- X/* NAME
- X/* tputs 3
- X/* SUMMARY
- X/* output string with padding
- X/* PROJECT
- X/* ms-dos/unix compatibility
- X/* PACKAGE
- X/* termcap
- X/* SYNOPSIS
- X/* tputs(cp,affcnt,outc)
- X/* char *p;
- X/* int affcnt;
- X/* int (*outc)();
- X/* DESCRIPTION
- X/* tputs interprets leading padding information in the string
- X/* pointed to by cp, and outputs through the function pointed
- X/* to by outc.
- X/*
- X/* In the MS-DOS implementation, padding information is not
- X/* needed.
- X/* SEE ALSO
- X/* termcap(3), Berkeley extensions to UNIX.
- X/* FILES
- X/* ANSI.SYS, ibm pc console driver.
- X/* AUTHOR(S)
- X/* W.Z. Venema
- X/* Eindhoven University of Technology
- X/* Department of Mathematics and Computer Science
- X/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
- X/* CREATION DATE
- X/* Wed Jan 1 19:01:13 GMT+1:00 1986
- X/* LAST MODIFICATION
- X/* 90/01/22 13:57:21
- X/* VERSION/RELEASE
- X/* 2.1
- X/*--*/
- X
- X#include "termcap.h"
- X
- X/* version does not check for padding */
- X
- Xtputs(cp, affcnt, outc)
- Xregister char *cp;
- Xint affcnt;
- Xregister int (*outc) ();
- X{
- X while (*cp)
- X (*outc) (*cp++);
- X}
- END_OF_termcap/tputs.c
- if test 1036 -ne `wc -c <termcap/tputs.c`; then
- echo shar: \"termcap/tputs.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of archive 1 \(of 11\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 11 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
-